package com.example.farmer.Presenter;

import androidx.fragment.app.Fragment;

import com.example.farmer.Fragment.Circle.FollowFragment;
import com.example.farmer.Fragment.Circle.LatestFragment;
import com.example.farmer.Model.Circle.CircleModel;
import com.example.farmer.View.CircleView;

import java.util.ArrayList;
import java.util.List;

public class CirclePresenter implements CircleModel,CircleView.Ipresenter {
    private CircleView mView;

    public CirclePresenter(CircleView view) {
        mView = view;
        mView.setPresenter(this);
    }
    public void onMyButtonClicked() {
        mView.navigateToMyProfile();
    }

    @Override
    public void getLatest(){
        List<String> latestList = new ArrayList<>();
        mView.showLatest(latestList);
    }

    @Override
    public void getFollow() {
        List<String> followList = new ArrayList<>();
        mView.showFollow(followList);
    }

    //CircleView.IPresenter接口方法
    public void onTabSelected(int position){
        switch (position){
            case 0:
                getLatest();
                break;
            case 1:
                getFollow();
                break;
            // 其他Tab的处理
        }
    }

}